Field of the Invention
Embodiments of the present invention generally relate to document conversion and, more particularly, to techniques for preserving fidelity of bounded rich text appearance by maintaining reflow when converting between interactive and flat documents across different environments.
Description of the Related Art
Plain text is represented as a pure sequence of character codes, such as ASCII codes, that only identify the content of characters of text and not their appearance. A “rich text” representation augments plain text by adding information that enhances the character content, such as font size, font color, text line end, language identifier, hypertext links, etc. If such enhancements are not maintained, a faithful representation, that is, the fidelity, of the rich text, will be lost.
It is not uncommon to enter rich text in an interactive document on a web page (via a browser) and then, later in time, view or edit the same document using a different browser or when the document is presented in a different form (e.g., a flattened Portable Document Format (PDF). HyperText Markup Language (HTML) is used to create web pages that can be displayed as an interactive document in a web browser. When text is entered into the interactive document, the text is added to an HTML element (e.g., a form field). The document, including text, is then saved and may be viewed later in a different web browser. Alternatively, the interactive document may be converted to a flattened document (i.e., a document without interactivity), for example a PDF and viewed later in a using a PDF reader. In either case, the saved text is of a same font-family, font-size, font-style, and other formatting metadata. However, the saved text may be displayed differently depending on the type of browser in which the text is later viewed. For example, text that was originally entered on a single line, when viewed later may be displayed on two lines. The later display of the text is different because each browser type understands, renders, and draws text style information differently. Also, boundary box dimensions for text entry areas in different browser types are different. As such, the display of a single line of entered text when using one browser type may display as two lines of text when using a different browser type. This provides a poor user experience. Therefore, there is a need for a method and apparatus for preserving fidelity of bounded rich text appearance by maintaining reflow when converting between interactive and flat documents across different environments.